package com.linciping.useges.plugin.writer;

import com.google.gson.Gson;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDirectory;
import com.linciping.useges.plugin.bean.UsegesNode;

import java.util.List;

public class UsegesJsonWriter extends BaseJsonUsegesWriter {

    private static final String FILE_NAME = "Useges.json";
    private final List<UsegesNode> usegesNodeList;

    public UsegesJsonWriter(Project project, PsiDirectory psiDirectory, List<UsegesNode> usegesNodeList) {
        super(project, psiDirectory);
        this.usegesNodeList = usegesNodeList;
    }

    @Override
    String getContent() {
        Gson gson = new Gson();
        return gson.toJson(usegesNodeList);
    }

    @Override
    String getFileName() {
        return FILE_NAME;
    }
}
